﻿@model Football.ViewModels.GameViewModel
<div class="clear-fix" id="whosin">
    @if (Model.HasActivePlayers)
    {
        <h3>
            Who's game?</h3>
    }
    else
    {
        <h3 id="no-one-yet">
            Nobody wants to meet the pain train yet!</h3>
    }
    @if (Model.HasInactivePlayers)
    { <mark id="show-the-quitters">Show the quitters!</mark>
        <mark id="hide-the-quitters">Hide the quitters!</mark>
    }
</div>
@if (Model.HasActivePlayers || Model.HasInactivePlayers)
{
    <ol class="round">
        @foreach (var player in Model.GamePlayerList)
        {
            <li class="clear-fix @if (player.GamePlayer.GamePlayerStatusId == 1)
                                 {
                @:in
                }
                                 else
                                 {
                @:out
                }" 
                    id="@player.GamePlayer.GamePlayerId">
                <div class="badgewrapper">
                    <span class="badge">
                        @if (player.GamePlayer.GamePlayerStatusId == 1)
                        {
                            @player.Index
                        }
                        else
                        {
                            @player.GamePlayer.GamePlayerStatuses.PlayerStatus
                        }</span>
                </div>
                <div class="playerwrapper">
                    <h5 class="playername">@player.GamePlayer.Name</h5>
                    <div class="playertime">
                    </div>
                </div>
                @if (player.GamePlayer.GamePlayerStatusId == 1)
                {
                    @Html.ActionLink(
                "x",
                "ToggleStatus",
                "Player",
                new { id = player.GamePlayer.GamePlayerId },
                new { @class = "close" }
            )
                }
            </li>
        }
    </ol>
}